home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / cmln0286.arc / BENMRK.DEF < prev    next >
Text File  |  1986-02-03  |  768b  |  35 lines

  1.  
  2.  
  3.                        The Deref Benchmark
  4.                         C Compiler Review
  5.                  February 1985 COMPUTER LANGUAGE
  6.  
  7.  
  8. /*
  9. **     deref.c -- benchmark program to examine the effeciency
  10. **  of pointer dereferencing
  11. */
  12.  
  13. #define LOOPS    50000      /* how many loops */
  14. #define BELL     7          /* ASCII bell character */
  15.  
  16. struct cptr1  {
  17.         char ********************ptr1;
  18.         };
  19.         
  20. main()
  21. {
  22. unsigned i;
  23. char yekdorb;
  24. struct cptr1 ********************pointer;
  25.  
  26.         printf("%u loops\n", LOOPS);
  27.         
  28.         for (i = 0; i <= LOOPS; i++)
  29.             yekdorb = ********************
  30.                 (********************pointer).ptr1;
  31.                         
  32.         printf("%cfinished\n", BELL);
  33.         exit(0);
  34. }
  35.